﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DataRole_Index.aspx.cs" Inherits="SysManage_DataRole_Index" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <title>数据角色</title>
    <link rel="stylesheet" href="../css/css.css"  type="text/css" />
    <script language="javascript" type="text/javascript">
     var stype;
     function btnMageClk(type)
     {  //debugger;
        stype = type;
        var sobj = district.form1.Hobj.value ;
        RoleForm.Hcode.value = sobj;
        var sFeatures = "dialogHeight:600px;dialogWidth:800px;resizeable:no;help:no;status:no";
        var sFeatures2 = "dialogHeight:400px;dialogWidth:500px;resizeable:no;help:no;status:no";
        //type:1-增加；2-修改；3-删除；4-查看；5-显示删除；6-隐藏删除；7-导出；8-恢复已经删除的数据

        switch (type)
        { 
             case 1://增加                                
                    showModalDialog("DataRole_Edit.aspx?sOrgtype=2&EditType=1",window,sFeatures);
                    //刷新GridView
                    //location.href ="DataRole_Edit.aspx?stype=1";
				    var btnRefresh=district.document.getElementById("BtnRefresh");
				    if(btnRefresh!=null)
				       btnRefresh.click();
                    break;
             case 2://修改
                    if(""==sobj)
                    {
                        alert("请选择要修改的角色");
                        return;
                    }
                    showModalDialog("DataRole_Edit.aspx?sOrgtype=2&EditType=2&Hcode=&CtrlRole="+district.form1.FuncRoleCoDE.value+"&DbRole="+district.form1.HCheckInCode.value,window,sFeatures);
                    //刷新GridView
                    //location.href ="DataRole_Edit.aspx?stype=2&CtrlRole="+district.form1.FuncRoleCoDE.value+"&Hcode="+sobj;
				    var btnRefresh=district.document.getElementById("BtnRefresh");
				    if(btnRefresh!=null)
				        btnRefresh.click();
                    break;
            case 3: //删除
                    if(""==sobj)
                    {
                        alert("请选择要删除的角色");
                        return;
                    }             
                    if(confirm("真的要删除该条记录？"))
                    {
				        var ifrmDel=district.document.getElementById("BtnDel");
				        if(ifrmDel!=null)
				        {
				          ifrmDel.click();
				        }
                    }
                    else
                    {
                        var btnRefresh=district.document.getElementById("BtnRefresh");
				        if(btnRefresh!=null)
				            btnRefresh.click();	
                    }
                    break;
            case 4://查看 
                    if(""==sobj)
                    {
                        alert("请选择角色信息后再查看");
                        return;
                    }             
                    showModalDialog("DataRole_View.aspx",window,sFeatures2);
//                    var btnRefresh=district.document.getElementById("BtnRefresh");
//				    if(btnRefresh!=null)
//				        btnRefresh.click();
                    break;          
            case 5: //显示删除      
                    //按钮处理      
				    window.document.all.btn_hide_del.style.display= "inline";
				    window.document.all.btn_disp_del.style.display= "none";
				    window.document.all.btn_resume.style.display= "inline";
				    window.document.all.btn_export.style.display= "none";
				    //操作按钮处理				    				    
				    window.document.all.btn_new_pd.disabled=true;
				    window.document.all.btn_hf_view.disabled=true;
				    window.document.all.btn_hf_del.disabled=true;
				    //window.document.all.btn_export.disabled=true;
				    //显示删除
				    var vDel=district.document.getElementById("BtnDispDel");
				    if(vDel!=null)vDel.click();
                    break;
            case 6: //隐藏删除
                    //本身删除变化按钮处理  
                    window.document.all.btn_disp_del.style.display= "inline";
				    window.document.all.btn_hide_del.style.display= "none";
				    window.document.all.btn_export.style.display= "none";
				    window.document.all.btn_resume.style.display= "none";
				    //操作按钮处理				    				    
				    window.document.all.btn_new_pd.disabled=false;
				    window.document.all.btn_hf_view.disabled=false;
				    window.document.all.btn_hf_del.disabled=false;
				    //window.document.all.btn_export.disabled=false;
				    //显示删除
				    var vDel=district.document.getElementById("BtnHideDel");
				    if(vDel!=null)vDel.click();
                    break;
            case 7: //导出
				    var ifrm=district.document.getElementById("BtnExport");
				    if(ifrm!=null)ifrm.click();
                    break;
            case 8: //恢复已经删除的数据

                    if(""==sobj)
                    {
                        alert("请选择一条记录进行恢复");
                        return;
                    } 
                    var d8 = sobj.split('~');
                    if("1"==d8[5])
                    {
                        alert("该行数据已经存在，不需要恢复");
                        return;
                    }
				    var ifrm=district.document.getElementById("BtnResume");
				    if(ifrm!=null)ifrm.click();
                    break;  
         }
     }
    </script>    
</head>
<body style =" background-image :url('../images/hit_bg.gif');">
  <form id="RoleForm" method ="post" runat ="server" >
  <table border="0" align="center" cellpadding="0" cellspacing="0"  style ="height :100%; width :100%;">
	<tr style ="height:8%;">
		<td >
            <table style ="width :98%;"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
               <td valign ="middle"  style ="height :22; width :100%;" ><img id="imgIndicator" src ="../images/Indicator.jpg" style ="width :21; height :16;" alt ="当前位置" />当前位置：<asp:Label ID="Indicator" runat ="server" ></asp:Label></td>
               </tr> 
              <tr style ="height :1; background-color :#dddddd;">
                <td></td>
             </tr> 
            </table>
	  	</td>
  	</tr>
  	<tr style ="height:87%;">
		<td>
	  		<iframe  id="district" height="100%" width="100%" src="DataRole_List.aspx" frameborder="0" >浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。</iframe>
	  </td>
  	</tr>
	<tr style ="height:5%;"> 
      <td align ="center" >
              <input name="btn_new_pd"  id="btn_new_pd" type="button" class="button03" onclick="btnMageClk(1)" value="增加(A)" accesskey ="a" runat ="server" />
              <input name="btn_hf_view"  id="btn_hf_view" type="button" class="button03"  onclick= "btnMageClk(2)" value="修改(E)" accesskey ="e" />
              <input name="btn_hf_del" id="btn_hf_del" type="button" class="button03"  onclick= "btnMageClk(3)"  value="删除(D)" accesskey ="d" />
              <input name="btn_view" id="btn_view" type="button" class="button03"  onclick= "btnMageClk(4)"  value="查看(V)" accesskey ="v" />
              <input name="btn_disp_del" id="btn_disp_del" type="button" class="button05"  onclick= "btnMageClk(5)"  value="显示删除(G)" accesskey ="g" style="display:inline;" />
              <input name="btn_hide_del" id="btn_hide_del" type="button" class="button05"  onclick= "btnMageClk(6)"    value="隐藏删除(H)" accesskey ="h"   style="display:none;" />
              <input name="btn_export" id="btn_export" type="button" class="button03"  onclick= "btnMageClk(7)"   value="导出(X)" accesskey ="x"  style="display:none;" />
              <input name="btn_resume" id="btn_resume" type="button" class="button03"  onclick= "btnMageClk(8)"   value="恢复(R)" accesskey ="r" style="display:none;" />
       </td>       
    </tr>
</table>
<input type="hidden" id="Hcode" runat ="server"  />
</form>
</body>
</html>
